package com.bms.cfcmms.dao;

import com.bms.cfcmms.util.SpringUtils;
import com.bms.cfcmms.model.system.SystemInfo;
import com.bms.cfcmms.model.system.module.Module;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Repository;

/**
 * Created by carl on 2016/4/19.
 */
@Repository
public class SystemInfoDao extends BaseDao<SystemInfo> {

    private static final Logger log = LoggerFactory.getLogger(SystemInfoDao.class);

    /**
     * 通过ID查询系统信息.
     *
     * @param rowId  记录ID
     * @return  系统信息
     */
    public SystemInfo queryForObjectById(Integer rowId) {
        Module module = moduleDao.queryForObjectByName(SystemInfo.class.getSimpleName());
        if (module == null) {
            log.error(SpringUtils.getMessage("module.notfind", "SystemInfo"));
            return null;
        }
        return queryForObjectById(rowId, module);
    }
}
